﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// NotReviewedButNeeded

#pragma once
#include "GcmpCommonDraw.h"

namespace gcmp
{
    enum class CursorType;
    class IUiView;
    class ICurve3d;
    class IControlDefinition;
    class IActionInputEventArgs;
    class IPropertyPanelEventArgs;
    class IPickFilter;
    class Vector3d;
    class IGraphicsNodeGroup;
    class IPlane;

    /// \brief 绘制拾取线的Behavior，方便定制绘制Action的行为。
    class GCMP_COMMON_DRAW_EXPORT IActionDrawCurvePickBehavior
    {
    public:
        /// \brief 析构函数
        virtual ~IActionDrawCurvePickBehavior() {}


        /// \brief 输入对话框特性相关方法
    public:
        /// \brief 定义Action输入对话框UI
        /// \param title [out] 对话框标题
        /// \param inputItems [out] 对话框配置项UI
        /// \return 定制成功则返回true，否则返回false
        virtual bool DefineInputDialog(std::wstring& title, std::vector<OwnerPtr<IControlDefinition>>& inputItems) = 0;

        /// \brief 对话框UI事件处理
        /// \param pArgs 输入事件参数
        /// \return 定制成功则返回true，否则返回false
        virtual bool OnActionInputEvent(gcmp::IActionInputEventArgs* pArgs) = 0;


        /// \brief 属性面板特性定制方法
    public:
        /// \brief 属性面板UI事件处理
        /// \param pArgs 输入事件参数
        /// \return 定制成功则返回true，否则返回false
        virtual bool OnPropertyPanelEvent(gcmp::IPropertyPanelEventArgs* pArgs) = 0;


        /// \brief 通用操作（Action）状态特性方法
    public:
        /// \brief 定义提示信息
        /// \param promptMsg [out] 提示字符串
        /// \return 定制成功则返回true，否则返回false
        virtual bool DefinePromptMsg(std::wstring& promptMsg) = 0 ;

        /// \brief 定义光标类型
        /// \param cursorType [out] 光标类型
        /// \return 定制成功则返回true，否则返回false
        virtual bool DefineCursorType(gcmp::CursorType& cursorType) = 0;

        /// \brief 初始化Action
        /// \param pCurrentView 当前Action运行所属的视图
        /// \return 定制成功则返回true，否则返回false
        virtual bool OnInitAction(IUiView* pCurrentView) = 0 ;

        /// \brief 绘制拾取线操作完成行为定制
        /// \param pCurrentView 当前Action运行所属的视图
        /// \param opCurve3d 操作选择集所得到的偏移后的Curve3d
        /// \return 定制成功则返回true，否则返回false
        virtual bool OnDrawCurvePickFinished(IUiView* pCurrentView, OwnerPtr<ICurve3d> opCurve3d) = 0; 

        /// \brief 响应Action释放
        /// \return 定制成功则返回true，否则返回false
        virtual bool OnDestroyAction() = 0;


        /// \brief 操作对象添加Offset特性定制
    public:
        /// \brief 获取偏移所在的平面
        /// \param pCurrentView 当前Action运行所属的视图
        /// \param plane [out] 偏移所在的平面
        /// \return 定制成功则返回true，否则返回false
        virtual bool GetOffsetPlane(gcmp::IUiView* pCurrentView, OwnerPtr<IPlane>& plane) = 0;

        /// \brief 获取偏移值
        /// \param offset [out] 偏移值
        /// \return 定制成功则返回true，否则返回false
        virtual bool GetOffsetValue(double& offset) = 0;


        /// \brief 预览显示特性方法
    public:
        /// \brief 随拾取状态变化更新预览表达数据
        /// \param pCurrentView 当前Action运行所属的视图
        /// \param mousePoint 本次拾取操作后，拾取点的模型空间坐标
        /// \param opCurve3d 与预选对象对应的偏移后的Curve3d
        /// \param opGNodeGroup [in, out]用来预览的表达数据
        /// \return 定制成功则返回true，否则返回false
        virtual bool OnUpdatePreview(gcmp::IUiView* pCurrentView, const gcmp::Vector3d& mousePoint, OwnerPtr<ICurve3d> opCurve3d, OwnerPtr<IGraphicsNodeGroup>& opGNodeGroup) = 0;
    

        /// \brief 该操作特有的特性方法
    public:
        /// \brief 定义拾取筛选器
        /// \param pickFilter [out] 拾取筛选器
        /// \return 定制成功则返回true，否则返回false
        virtual bool DefinePickFilter(gcmp::OwnerPtr<gcmp::IPickFilter>& pickFilter) = 0;
    };
}
